struct ListNode* deleteDuplication(struct ListNode* pHead) {
	// write code here
	if (pHead == NULL)
	{
		return NULL;
	}
	if (pHead->next == NULL)
	{
		return pHead;
	}
	struct ListNode* pear = NULL;
	struct ListNode* cur = pHead;
	struct ListNode* next = pHead->next;
	while (next)
	{
		if (cur->val != next->val)
		{
			pear = cur;
			cur = next;
			next = cur->next;
		}
		else
		{
			while (next&&next->val == cur->val)
			{
				next = next->next;
			}
			if (pear)
			{
				pear->next = next;
			}
			else
			{
				pHead = next;
			}
			while (cur != next)
			{
				struct ListNode*destory = cur;
				cur = cur->next;
				free(destory);
			}
			if (next)
			{
				next = next->next;
			}
		}
	}
	return pHead;
}